package com.sl.biz.modular.ai.controller;

import com.sl.biz.modular.ai.dao.domain.entity.AiConfigDO;
import com.sl.biz.modular.ai.service.AiConfigBizService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ai")
@RequiredArgsConstructor
public class AiConfigController {

    private final AiConfigBizService cdcBizService;


    @PostMapping("/list")
    public List<AiConfigDO> list(@RequestBody AiConfigDO jobConfigDO) {
        return cdcBizService.list(jobConfigDO);
    }

    @PostMapping("/get_by_id")
    public AiConfigDO getById(@RequestBody AiConfigDO cdcConfigDO) {
        return cdcBizService.getById(cdcConfigDO);
    }

    @PostMapping("/remove_by_id")
    public Boolean removeById(@RequestBody AiConfigDO cdcConfigDO) {
        return cdcBizService.removeById(cdcConfigDO);
    }

    @PostMapping("/save")
    public Boolean save(@RequestBody AiConfigDO cdcConfigDO) {
        return cdcBizService.save(cdcConfigDO);
    }

    @PostMapping("/set_status_flag")
    public Boolean setStatusFlag(@RequestBody @Validated AiConfigDO assertUserUse) {
        return cdcBizService.setStatusFlag(assertUserUse);
    }

}
